package tech.zjp.ssm.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import tech.zjp.ssm.entity.Bill;
import tech.zjp.ssm.mapper.BillMapper;
import tech.zjp.ssm.service.BillService;

/**
 *
 * @Description: 
 * @Author: 周军鹏
 * @Date: 2020年3月4日 下午2:36:06
 */
@Service
public class BillServiceImpl implements BillService {

	@Autowired
	private BillMapper billMapper;
	@Override
	public List<Bill> getBillList(String productName, Integer providerId, Integer isPayment, Integer pageNum,
			Integer pageSize) {
		return billMapper.getBillList(productName, providerId, isPayment, (pageNum-1)*pageSize, pageSize);
	}

	@Override
	public int getBillCount(String productName, Integer providerId, Integer isPayment) {
		return billMapper.getBillCount(productName, providerId, isPayment);
	}

	@Override
	public boolean add(Bill bill) {
		return billMapper.add(bill)>0?true:false;
	}

	@Override
	public Bill getBillById(Integer id) {
		return billMapper.getBillById(id);
	}

	@Override
	public boolean modify(Bill bill) {
		return billMapper.modify(bill) > 0?true:false;
	}

	@Override
	public boolean deleteBillById(Integer delId) {
		return billMapper.deleteBillById(delId) > 0?true:false;
	}

}
